//    Copyright (C) Kherty.  All rights reserved.
using System;
using OpenLS.Core.Serialization;

namespace OpenLS.Vml
{
    class Handle: IOfficeXmlSerializable
    {
        private string radiusrange;
        private string position;
        private string polar;
        private string map;
        private bool? invy;
        private bool? invx;
        private string _switch;
        private string xrange;
        private string yrange;

        public void ReadXml(ReadContext context)
        {
           using (var c = context.Read("h"))
           {
               position = c.GetOptionalString("position");
               polar = c.GetOptionalString("polar");
                   map = c.GetOptionalString("map");
                   invx = c.GetOptionalBoolean("invx");
                 invy = c.GetOptionalBoolean("invy");
               _switch = c.GetOptionalString("switch");
               xrange = c.GetOptionalString("xrange");
               yrange = c.GetOptionalString("yrange");
               radiusrange = c.GetOptionalString("radiusrange");
           }
        }

        public void WriteXml(WriteContext context)
        {
            using (var c = context.Write("h"))
            {
                c.SetOptionalString("position", position);
                c.SetOptionalString("polar", polar);
                c.SetOptionalString("map", map);
                c.SetOptionalBoolean("invx", invx);
                c.SetOptionalBoolean("invy", invy);
                c.SetOptionalString("switch", _switch);
                c.SetOptionalString("xrange", xrange);
                c.SetOptionalString("yrange", yrange);
                c.SetOptionalString("radiusrange", radiusrange);
            }
        }
    }
}
